package fin_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 财务-车辆退款原因
type finVehRetReason int

var FinVehRetReason finVehRetReason

// 过户注销
func (c *finVehRetReason) TransferCancel() int {
	return 1
}

// 营运证注销
func (c *finVehRetReason) OperLicenseCancel() int {
	return 2
}

// 报废
func (c *finVehRetReason) Scrap() int {
	return 3
}

// 其他原因
func (c *finVehRetReason) Other() int {
	return 9
}

func (c *finVehRetReason) ToText(value int) string {
	switch value {

	case 1:
		return "过户注销"

	case 2:
		return "营运证注销"

	case 3:
		return "报废"

	case 9:
		return "其他原因"

	}
	return ""
}

func (c *finVehRetReason) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *finVehRetReason) ToValue(text string) int {
	switch text {

	case "过户注销":
		return 1

	case "营运证注销":
		return 2

	case "报废":
		return 3

	case "其他原因":
		return 9

	}
	return 0
}
